package com.ling.pl.demo.model;

import com.ling.pl.core.commons.annotation.ModelProperty;
import com.ling.pl.core.hibernate.identifier.Ling2UUIDGenerator;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import javax.persistence.*;

/**
 * Created by bo.wang on 2017/4/8.
 */
@Entity
@Table(name = Demo.TABLE)
public class Demo extends BaseDemo {

    public static final String TABLE = "T_DEMO";
    public static final String SEQ = TABLE;

    @ModelProperty(comment = "源科目ID")
    @Id
    @GenericGenerator(name = SEQ + "_GENERATOR", strategy = Ling2UUIDGenerator.STRATEGY_NAME, parameters = {@Parameter(name = "pkColumnValue", value = SEQ)})
    @GeneratedValue(strategy = GenerationType.TABLE, generator = SEQ + "_GENERATOR")
    @Column(name = "SOURCE_ACCOUNT_ID", unique = true, nullable = false, length = 36)
    String id;

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
